package webpage

import (
	"fmt"

	"github.com/gogf/gf/v2/net/ghttp"
)

type WebPage struct {}

func New() *WebPage {
  return &WebPage{}
}

func (w *WebPage) Get(req *ghttp.Request) {
  filePath := fmt.Sprintf("/resource/dist/index.html")
  req.Response.ServeFile(filePath)
}

func (w *WebPage) GetIcon(req *ghttp.Request) {
  filePath := fmt.Sprintf("/resource/dist/favicon.png")
  fmt.Println(filePath)
  req.Response.ServeFile(filePath)
}

func (w *WebPage) GetDists(req *ghttp.Request) {
  filePath := fmt.Sprintf("/resource/dist/%s", req.Get("any"))
  fmt.Println(filePath)
  req.Response.ServeFile(filePath)
}
